package com.zl.model;

import com.zl.controller.annotation.CheckPassword;
import com.zl.controller.annotation.First;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author ZLL
 * @date create in 2018/04/26
 */

//@CheckPassword(message = "xxxxxxxxxxxxxx", groups = First.class)
public class User implements Serializable{

    @NotNull(message = "{user.id.null}")
    private Integer id;

    @NotNull(message = "{user.name.null}")
    @Length(min = 5, max = 20, message = "{user.name.length.illegal}")
    private String name;

    private int age;

    @NotNull(message = "{user.password.null}")
    private String password;

    @NotNull(message = "{user.confirmation.null}")
    private String confirmation;

    private Addr addr;

    public User(){
        System.out.println(111);
    }

    public User(Integer id, String name) {
        this.id = id;
        this.name = name;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getConfirmation() {
        return confirmation;
    }

    public void setConfirmation(String confirmation) {
        this.confirmation = confirmation;
    }

    public Addr getAddr() {
        return addr;
    }

    public void setAddr(Addr addr) {
        this.addr = addr;
    }
}
